package com.todo.event.activity.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author azhebuxing
 * @date 2025/1/7 20:03
 * @description
 */
@Getter
@AllArgsConstructor
public enum DecisionTypeEnum {

    SINGLE(1, "SINGLE", "单事件"),
    MULTIPLE(2, "MULTIPLE", "多事件"),
    ;

    private static Map<Integer, DecisionTypeEnum> typeMap = Arrays
            .stream(DecisionTypeEnum.values())
            .collect(Collectors.toMap(DecisionTypeEnum::getType, item -> item, (v1, v2) -> v2));

    private int type;
    private String code;
    private String name;


    public static DecisionTypeEnum getByType(Integer type) {
        return typeMap.get(type);
    }
}
